<!DOCTYPE htmml>
<html lang="en">
<head>
    <meta charset="UTF-8">
	<title>背景颜色</title>
	<style>
	    div{
		    height:50px;
			margin-top:20px;
		}
		.bg1{
		    background-color:red;
		}
		.bg2{
		    background-color:#f00;
		}
		.bg3{
		    background-color:rgb(255,0,0)
		}
		.bg4{
		    background-color:rgba(255,0,0,0.5)
		}<!--a 表示透明度-->
	</style>
</head>
<body>
    <div class="bg1">div1</div>
	<div class="bg2">div2</div>
	<div class="bg3">div3</div>
	<div class="bg4">div4</div>
</body>
</html>